FSpOpenRF
FSpOpenRF
Create an access path to the resource fork of a file char permission ; permission level
short *refNum ; points to a path reference number
FSpOpenRF creates an access path to the resource fork of a file. It is the high-level, FSSpec version of PBHOpenRF. Resources are normally details automatically. About the only reason to use FSpOpenRF is to perform a file-copy operation.
spec is a pointer to an FSSpec record specifying the file to be opened. permission is used to request the kind of access path permission you want.
refNum points to the path reference number. FSpOpenRF opens the resource fork and places the path reference number in the refNum
parameter.
Returns: an operating system Error Code. It will be one of: noErr (0) No error
bdNamErr (-37) Bad name
dirNFErr (-120) Directory not found or incomplete pathname
extFSErr (-58) External file system
fnfErr (-43) File not found
ioErr (-36) I/O error
nsvErr (-35) No such volume
opWrErr (-49) File already open for writing
permErr (-54) Attempt to open locked file for writing
tmfoErr (-42) Too many files open
Notes: FSpOpenRF takes a permission parameter In most cases, you can simply set the permission parameter to fsCurPerm.
Some applications request fsRdWrPerm, to ensure that they can both read
and write to a file. The constants that can be passed in this field are the
following:
fsCurPerm exclusive read/write permission if it is available;
otherwise, exclusive read, if that is available
fsRdPerm exclusive read permission
fsWrPerm exclusive write permission
fsRdWrPerm exclusive read/write permission
fsRdWrShPerm shared read/write permission
In shared environments, permission requests are translated into the
"deny-mode" permissions defined by AppleShare.